<!DOCTYPE html>
<html lang="en">
<head>
    <meta content="yes" name="apple-mobile-web-app-capable">
    <meta content="yes" name="apple-touch-fullscreen">
    <meta content="telephone=no,email=no" name="format-detection">
    <meta name="wap-font-scale" content="no">
    <meta charset="UTF-8" name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">

    <!--<meta name="apple-mobile-web-app-title" content="标题">
    <meta name="apple-mobile-web-app-capable" content="yes"/>
    &lt;!&ndash;是否启用 WebApp 全屏模式，删除苹果默认的工具栏和菜单栏&ndash;&gt;
    <meta name="apple-itunes-app" content="app-id=myAppStoreID, affiliate-data=myAffiliateData, app-argument=myURL">
    &lt;!&ndash;添加智能 App 广告条 Smart App Banner（iOS 6+ Safari）&ndash;&gt;
    <meta name="apple-mobile-web-app-status-bar-style" content="black"/>
    <meta name="format-detection" content="telphone=no, email=no"/>


    <meta name="apple-mobile-web-app-title" content="标题"> &lt;!&ndash; 添加到主屏后的标题（iOS 6 新增） &ndash;&gt;
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />-->
    <!-- 设置状态栏的背景颜色，只有在 `"apple-mobile-web-app-capable" content="yes"` 时生效 -->

    <title><?=$title?></title>
    <link rel="stylesheet" href="/mobile/css/reset.css">
    <link rel="stylesheet" href="/mobile/css/mui.min.css">
    <link rel="stylesheet" href="/mobile/js/swiper/swiper.min.css">
    <script src="/mobile/js/flexible_css.debug.js"></script>
    <script src="/mobile/js/flexible.debug.js"></script>
    <link rel="stylesheet" href="/mobile/css/main_train.css">

</head>
<body style="background: #f5f5f5;">
<div id="back-btn-wrap">
    社区
</div>
<div class="content-main">
    <section class="gr-top-wrap">
        <a href="/mobile/society/demand">
            <img src="/mobile/img/icon-1.png" alt="">
            <p>需求发布</p>
        </a>
        <a href="/mobile/question/excellent">
            <img src="/mobile/img/icon-2.png" alt="">
            <p>最佳学员</p>
        </a>
        <a href="/mobile/society/societyLists">
            <img src="/mobile/img/icon-3.png" alt="">
            <p>论坛发帖</p>
        </a>
    </section>
    <section class="gr-mid-wrap">
        <h2 class="clearfix">贴吧 <a href="/mobile/society/societyLists?" class="fr btn-right"></a></h2>
        <ul id="gr-forum-list">
        </ul>
    </section>
    <section class="gr-bot-wrap">
        <h2>最佳学员 <a href="/mobile/question/excellent" class="fr btn-right"></a></h2>
        <div class="swiper-container member-container"  style="">
            <div class="swiper-wrapper member-wrap">
            </div>
        </div>
    </section>

</div>
<script src="/mobile/js/jquery.min.js"></script>
<script src="/mobile/js/common.js"></script>
<script src="/mobile/js/mui.min.js"></script>
<script src="/mobile/js/swiper/swiper.min.js"></script>
<script src="/mobile/js/jrrpc.js"></script>

<script>
    $(function(){
        mui.init();
        var token = iService.getQueryString('token');
        if(!token){
            mui.alert('缺少token',' ');
            return false;
        }
        sessionStorage.token = token;
        var param = {
            postData:'Society/home',
            data:{
                token:token
            }
        };

        $.JsonRpc(param,function(result){
            console.log(result);
            var goodStudentList = result.data.question;
            var forumList = result.data.society;

            if(!forumList.length){
                $('#gr-forum-list').html('<p class="null-wrap">暂无数据</p>');
            }else {
                $.each(forumList,function(i){
                    $(
                            '<li class="item clearfix">'+
                            '<a href="/mobile/society/detail?sid='+forumList[i].sid+'">'+
                            '<div class="avatar-wrap fl">'+
                            '<img class="avatar" src="'+forumList[i].avatar+'" alt="">'+
                            '</div>'+
                            '<div class="list-right-wrap">'+
                            '<h3 class="clearfix">'+forumList[i].title+'</h3>'+
                            '<p class="tips-wrap clearfix">'+
                            '<span>'+forumList[i].nickname+'</span>'+
                            '<b> '+String(forumList[i].createtime).slice(0,10)+'</b>'+
                            '<i class="fr comment-num">'+forumList[i].comment+'</i>'+
                            '</p>'+
                            '</div>'+
                            '</a>'+
                            '</li>'
                    ).appendTo('#gr-forum-list');
                });
            }
            if(!goodStudentList.length){
                $('.member-wrap').html('<p class="null-wrap">暂无数据</p>');
            }else {
                $.each(goodStudentList,function(i) {
                    $(
                            '<div class="swiper-slide">'+
                            '<a href="javascript:void(0)" style="background: url('+goodStudentList[i].avatar+') center center"></a>'+
                            '<h4>'+goodStudentList[i].nickname+'</h4>'+
                            '<h4>'+goodStudentList[i].section+'</h4><span>正确率:'+parseInt((goodStudentList[i].correct/goodStudentList[i].total)*100)+'%</span></p>'+
                            '</div>'
                    ).appendTo('.member-wrap');
                });

                //回放滑动列表
                var swiper = new Swiper('.swiper-container', {
                    scrollbar: null,
                    scrollbarHide: true,
                    slidesPerView: 'auto',
                    centeredSlides: false,
                    spaceBetween: '1.33%',
                    grabCursor: false,
                    momentumBounce:0
                });
            }
        });
        $.get('https://www.wzxaini9.cn/api/flow/index/id/11', function (data) {
            console.log($.parseJSON(data));
        })
    });
</script>
</body>
</html>












